package JavaEE初阶;


import javax.sound.midi.Soundbank;

class SinglenoLazy{
    private static SinglenoLazy instance = getInstance();

    public static SinglenoLazy getInstance(){
        if(instance == null){
            synchronized (SinglenoLazy.class){
                if(instance == null){
                    instance  = new SinglenoLazy();
                }
            }
        }
        return instance;
    }
    private SinglenoLazy(){

    }
}

public class Demo05 {
    public static void main(String[] args) {
        SinglenoLazy s1 = SinglenoLazy.getInstance();
        SinglenoLazy s2 = SinglenoLazy.getInstance();
        System.out.println(s1==s2);
    }
}
